﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Work.UI.Web.MVC.Models.Registration
{
    public class UserModel
    {
        [Required(ErrorMessage = "Обовязкове поле.")]
        [StringLength(25, MinimumLength = 3,ErrorMessage = "Min 3, Max 25")]
        [Display(Name = "User Name")]
        public string Name { get; set; }

        [Required(ErrorMessage = "Обовязкове поле")]
        [RegularExpression(@"\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*", ErrorMessage = "Не вірно заповнене поле.")]
        public string Email { get; set; }

        [Required(ErrorMessage = "Обовязкове поле")]
        [StringLength(25,MinimumLength = 4, ErrorMessage = "Min 4, Max 25.")]
        public string Password { get; set; }

        [Display(Name = "Confirm password")]
        [Compare("Password", ErrorMessage = "Паролі не співпадають.")]  
        public string ComparePassword { get; set; }
    }
}